package pers.zhuli.weblog.utils;

import java.util.Random;

public class StringUtils {
    public static String randomString(int length) {
        String str = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890";
        StringBuilder stringBuilder = new StringBuilder();
        Random random = new Random();
        int max = str.length();
        for (int i = 0; i < length; i++) {
            stringBuilder.append(str.charAt(random.nextInt(max)));
        }
        return stringBuilder.toString();
    }
}
